<% variant = line_item.variant %>

<%= order_form.fields_for :line_items, line_item do |item_form| %>
  <div class="d-table-row shopping-cart-item">
    <div class="d-table-cell shopping-cart-item-image" data-hook="cart_item_image">
      <%= link_to product_image(variant), spree.product_path(variant.product) %>
    </div>
    <div class="d-table-cell shopping-cart-item-description" data-hook="cart_item_description">
      <h2 class="item-title"><%= link_to line_item.name, spree.product_path(variant.product) %></h2>
      <% if line_item.insufficient_stock? %>
        <span class="out-of-stock">
          <%= Spree.t(:out_of_stock) %>&nbsp;&nbsp;<br>
        </span>
      <% end %>
      <ul class="item-details-list" data-hook="line_item_description">
        <% variant.option_values.sort { |ov| ov.option_type.position }.each do |ov| %>
          <li class="item-details">
            <% # TODO: rework option values so options_text method can be used here %>
            <%= "#{ov.option_type.presentation}: #{ov.name.titleize}" %>
          </li>
        <% end %>
      </ul>
      <%= render 'line_item_data', view: 'mobile', line_item: line_item, item_form: item_form %>
    </div>
    <%= render 'line_item_data', view: 'desktop', line_item: line_item, item_form: item_form %>
  </div>
<% end %>
